package com.platform.enums.formatters;

import com.platform.enums.ConfValueMode;
import org.springframework.format.Formatter;

import java.util.Locale;

/**
 * Description: 前端字符串转ConfValueModeEnum枚举
 *
 * @author libin Created on 2019/7/18
 **/
public class ConfValueModeFormatter implements Formatter<ConfValueMode> {
    @Override
    public ConfValueMode parse(String text, Locale locale) {
        return ConfValueMode.getByValue(text);
    }

    @Override
    public String print(ConfValueMode object, Locale locale) {
        return object.getValue();
    }
}
